package com.guoxin.chapter3.join.joinmoretest;

/**
 * @author guoxin
 * @date 2019年8月23日
 */
public class ThreadA extends Thread{

	private ThreadB threadB;

	public ThreadA(ThreadB threadB) {
		super();
		this.threadB = threadB;
	}
	
	@Override
	public void run() {
		try {
			synchronized (threadB) {
				System.out.println("begin A ThreadName="+Thread.currentThread().getName()+" "+System.currentTimeMillis());
				Thread.sleep(5000);
				System.out.println("end A ThreadName="+Thread.currentThread().getName()+" "+System.currentTimeMillis());
			}
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
